$unit1px: 2*1upx;

@mixin singleClass($name,$i,$map:(start:0,single:false,unit:$unit1px,prefix:null)) {
    $unit: map_get($map, unit);
    $className: $name;
    @if map_get($map, prefix) != null {
        $prefix: map_get($map, prefix);
        $className: $name + -$prefix;
    }
    &.azm-#{$className}-#{$i} {
        #{$name}: $i * $unit;
    }
}

@mixin loopClass($name:margin,$len:100,$map:(start:0,single:false,unit:$unit1px,prefix:null)) {
    $unit: map_get($map, unit);
    $className: $name;
    @if map_get($map, prefix) != null {
        $prefix: map_get($map, prefix);
        $className: $name + -$prefix;
    }
    @for $i from map_get($map, start) through $len {
        *, view, text, button {
            @include singleClass($name, $i, $map);
            @if map_get($map, single) != true {
                $list: right left top bottom lr tb lrb tlr tlb;
                @each $key in $list {
                    &.azm-#{$className}-#{$key}-#{$i} {
                        @if $key == tb {
                            #{$name}-top: $i * $unit;
                            #{$name}-bottom: $i * $unit;
                        } @else if $key == lr {
                            #{$name}-left: $i * $unit;
                            #{$name}-right: $i * $unit;
                        } @else if $key == lrb {
                            #{$name}-left: $i * $unit;
                            #{$name}-right: $i * $unit;
                            #{$name}-bottom: $i * $unit;
                        } @else if $key == tlr {
                            #{$name}-left: $i * $unit;
                            #{$name}-right: $i * $unit;
                            #{$name}-top: $i * $unit;
                        } @else if $key == tlb {
                            #{$name}-left: $i * $unit;
                            #{$name}-bottom: $i * $unit;
                            #{$name}-top: $i * $unit;
                        } @else {
                            #{$name}-#{$key}: $i * $unit;
                        }
                    }
                }
            }
        }
    }
}


//定义10-100的字体大小
@include loopClass(font-size, 100, (start:10, single:true, unit:$unit1px))
//定义0-100的宽度(px2rem)
@include loopClass(width, 100, (start:10, single:true, unit:$unit1px))
//定义0%-100%的宽度
@include loopClass(width, 100, (start:0, single:true, unit:1%, prefix:percent))
//定义0-100的高度(px2rem)
@include loopClass(height, 100, (start:10, single:true, unit:$unit1px))
//定义0%-100%的高度
@include loopClass(height, 100, (start:0, single:true, unit:1%, prefix:percent))
//定义0-100的padding 多属性
@include loopClass(padding, 100)
//定义0-100的margin 多属性
@include loopClass(margin, 100)

@mixin fixedAttributes($list) {

}

@function color($color-name) {
    @return var(--#{$color-name});
}

